/**
 * 用户认证、记住密码工具
 * @author 杨世峰
 */

import Cookies from 'js-cookie'

const TokenKey = 'Access-Token'
const USER_ID = 'User-ID'
const ROLE_ID = 'Role-ID'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getUserId() {
  return Cookies.get(USER_ID)
}

export function setUserId(userId) {
  return Cookies.set(USER_ID, userId)
}

export function removeUserId() {
  return Cookies.remove(USER_ID)
}

export function getRoleId() {
  return Cookies.get(ROLE_ID)
}

export function setRoleId(roleId) {
  return Cookies.set(ROLE_ID, roleId)
}

export function removeRoleId() {
  return Cookies.remove(ROLE_ID)
}